<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link href="favicon.ico" rel="shortcut icon" />
<title>会员绑定</title>
<meta name="description" content="" />
<meta name="keywords" content="会员绑定" />
<link type="text/css" rel="stylesheet" href="/assets/base/jiujiajiu/css/style.css">
<link type="text/css" rel="stylesheet" href="/assets/base/jiujiajiu/css/notice.css">
<script type="text/javascript" src="/assets/base/jiujiajiu/js/jquery.min.js"></script>
<script type="text/javascript" src="/assets/base/jiujiajiu/js/notice.js"></script>
<script type="text/javascript" src="/assets/base/jiujiajiu/js/support.js"></script>
</head>
<body>
	<div class="mainlogo">
		<img src="/assets/base/jiujiajiu/images/logo.png">
	</div>
	<div class="pw">
		<section class="body_main">
			<!--内容开始-->
			<div id="todayList">
				<!--显示相册名称+说明-->
				<ul class="chatPanel">
					<li class="media">
						<div class="def_list_1">
							<table width="100%" border="0" align="center" valign="top" cellpadding="0" cellspacing="0">
								<tr>
									<td align="center" class="active01"><a href="{BEESCRM::U('Base/Jiujiajiu/register',array('wechat_id'=>$wechat_id))}">注册会员</a>
									</td>
									<td width="1" style="border-right: 1px #ddd solid"></td>
									<td align="center"><a href="{BEESCRM::U('Base/Jiujiajiu/binding',array('wechat_id'=>$wechat_id))}">会员绑定</a></td>
								</tr>
							</table>
						</div>
						<div class="clear"></div>
						<table width="100%" border="0" cellspacing="0" cellpadding="0" class="zchy">
							<tr>
								<td align="right">手&nbsp;&nbsp;&nbsp;机：</td>
								<td><input type="text" class="mrinput" id='tel' placeholder='填写手机或会员卡号'></td>
							</tr>
							<tr>
								<td align="right">会员卡：</td>
								<td><input type="text" class="mrinput" id='card'></td>
							</tr>
						</table>
						<div class="clear"></div>
					</li>
				</ul>
			</div>
			<!--内容结束-->
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td height="94" align="center">
						<input class="mrbtn" value="会员绑定" type="submit" onclick='binding()'/>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<p style="padding: 10px; text-align: left; text-indent: 2em;">已经是会员？您可以填写上方信息进行绑定，虚拟会员卡拥有实体会员卡的所有功能。</p>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">&nbsp;</td>
				</tr>
				<!-- <tr>
					<td colspan="2" align="center"><h4>还不是会员？现在注册即可领取惊喜大礼！</h4></td>
				</tr> -->
				<tr>
					<td colspan="2" align="center">&nbsp;</td>
				</tr>
			</table>
		</section>
		<div class="body_footer">客服热线400-888-9979</div>
	</div>
	
	<script type="text/javascript">
		function binding(){
			var verify=/1[3-8]+\d{9}/;
			var tel=$('#tel').val();
			var card=$('#card').val();
			if(verify.test(tel) || card){
				$.ajax({
					type:'post',
					dataType:'post',
					data:{'tel':tel,'card':card},
					url:"{BEESCRM::U('Base/Jiujiajiu/doBinding',array('wechat_id'=>$wechat_id))}",
					complete:function(data){					//此处jQuery无法解析json,所以采用complete人工解析
						var json=eval("("+data.responseText+")");
						if(json.status=='S'){
							infotips(json.message,$('.submit_tips'),'right');
							setTimeout("location.href='{BEESCRM::U('Base/Jiujiajiu/card',array('wechat_id'=>$wechat_id))}'",2000);
						}else{
							infotips(json.message,$('.submit_tips'));
						}
					}
				});
			}else{
				infotips('请输入正确信息',$('.submit_tips'));
			}
		}
	
	</script>
</body>
</html>